/*
 * @@Title:
 * @@Description:
 *
 * @@Author: JZT.胡彪
 * @Date: 2024-07-04 21:35:20
 * @LastEditors: JZT.胡彪
 * @LastEditTime: 2024-07-21 21:37:26
 */
import request from '@/utils/request'
import Vue from 'vue'

// 获取产品列表
export const queryProductList = data => {
    return request({
        url: Vue.prototype.$api.product.index,
        method: 'post',
        data,
    })
}
// 获取产品详情
export const getDetail = data => {
    return request({
        url: Vue.prototype.$api.product.getInfo,
        method: 'post',
        data,
    })
}
// 新增产品
export const addProduct = data => {
    return request({
        url: Vue.prototype.$api.product.add,
        method: 'post',
        data,
    })
}
// 编辑产品
export const editProduct = data => {
    return request({
        url: Vue.prototype.$api.product.edit,
        method: 'post',
        data,
    })
}
// 上传图片
export const uploadImage = data => {
    return request({
        url: Vue.prototype.$api.product.uploadImage,
        method: 'post',
        data,
    })
}

// 上传url图片
export const uploadUrlImages = data => {
    return request({
        url: Vue.prototype.$api.product.uploadUrlImages,
        method: 'post',
        data,
    })
}
// 获取产品分类树列表
export const getTreeList = data => {
    return request({
        url: Vue.prototype.$api.product.getTreeList,
        method: 'post',
        data,
    })
}
// 获取产品属性树列表
export const getAppendLevel = data => {
    return request({
        url: Vue.prototype.$api.product.getAppendLevel,
        method: 'post',
        data,
    })
}
// 获取产品特性
export const getProductTag = data => {
    return request({
        url: Vue.prototype.$api.product.getProductTag,
        method: 'post',
        data,
    })
}
// 获取产品尺寸类型下拉列表
export const getSizeLevel = data => {
    return request({
        url: Vue.prototype.$api.product.getSizeLevel,
        method: 'post',
        data,
    })
}
// 获取采购类型列表
export const getPurchaseLevel = data => {
    return request({
        url: Vue.prototype.$api.product.getPurchaseLevel,
        method: 'post',
        data,
    })
}
// 获取变体属性列表
export const getSkuAttr = data => {
    return request({
        url: Vue.prototype.$api.product.getSkuAttr,
        method: 'post',
        data,
    })
}
// 获取开发类型列表
export const getDevelopType = data => {
    return request({
        url: Vue.prototype.$api.product.getDevelopType,
        method: 'post',
        data,
    })
}
// 新增Sku
export const addSellerSku = data => {
    return request({
        url: Vue.prototype.$api.product.addSellerSku,
        method: 'post',
        data,
    })
}
// 编辑子Sku
export const editSellerSku = data => {
    return request({
        url: Vue.prototype.$api.product.editSellerSku,
        method: 'post',
        data,
    })
}
// 编辑子Sku列表
export const getSellerSkuList = data => {
    return request({
        url: Vue.prototype.$api.product.getSellerSkuList,
        method: 'post',
        data,
    })
}
// 获取产品分类大类
export const getAttrList = data => {
    return request({
        url: Vue.prototype.$api.product.getAttrList,
        method: 'post',
        data,
    })
}
// 新增颜色 
export const addColor = data => {
    return request({
        url: Vue.prototype.$api.product.addColor,
        method: 'post',
        data,
    })
}
// 删除颜色 
export const deleteColor = data => {
    return request({
        url: Vue.prototype.$api.product.deleteColor,
        method: 'post',
        data,
    })
}
// 下载
export const exportProduct = data => {
    return request({
        url: Vue.prototype.$api.product.export,
        method: 'post',
        data,
        responseType: 'blob',
    })
}
// 产品库存管理接口
export const getInventoryList = data => {
    return request({
        url: Vue.prototype.$api.product.inventory,
        method: 'post',
        data,
    })
}
export const getStockList = data => {
    return request({
        url: Vue.prototype.$api.product.stock,
        method: 'post',
        data,
    })
}
export const exportInventory = data => {
    return request({
        url: Vue.prototype.$api.product.exportInventory,
        method: 'post',
        data,
        responseType: 'blob',
    })
}
export const exportInventoryinfo = data => {
    return request({
        url: Vue.prototype.$api.product.exportInventoryinfo,
        method: 'post',
        data,
        responseType: 'blob',
    })
}
// 编辑库存
export const editInventory = data => {
    return request({
        url: Vue.prototype.$api.product.editInventory,
        method: 'post',
        data,
    })
}

export const queryProductNewList = data => {
    return request({
        url: Vue.prototype.$api.product.productNewIndex,
        method: 'post',
        data,
    })
}
export const queryProductNewDetail = data => {
    return request({
        url: Vue.prototype.$api.product.productNewDetail,
        method: 'post',
        data,
    })
}
export const productNewAdd = data => {
    return request({
        url: Vue.prototype.$api.product.productNewAdd,
        method: 'post',
        data,
    })
}
export const productNewEdit = data => {
    return request({
        url: Vue.prototype.$api.product.productNewEdit,
        method: 'post',
        data,
    })
}
export const productNewAudit = data => {
    return request({
        url: Vue.prototype.$api.product.productNewAudit,
        method: 'post',
        data,
    })
}

export const queryProductOutList = data => {
    return request({
        url: Vue.prototype.$api.product.productOutIndex,
        method: 'post',
        data,
    })
}
export const queryProductOutSpuInfo = data => {
    return request({
        url: Vue.prototype.$api.product.productOutInfo,
        method: 'post',
        data,
    })
}
export const getWarehouse = data => {
    return request({
        url: Vue.prototype.$api.product.getWarehouse,
        method: 'post',
        data,
    })
}


// 报表列表
export const getStatementList = data => {
    return request({
        url: Vue.prototype.$api.StatementList.index,
        method: 'post',
        data,
    })
}
export const deleteItem = data => {
    return request({
        url: Vue.prototype.$api.StatementList.delete,
        method: 'post',
        data,
    })
}
export const deleteItemP = data => {
    return request({
        url: Vue.prototype.$api.StatementList.deleteP,
        method: 'post',
        data,
    })
}
export const addStatement = data => {
    return request({
        url: Vue.prototype.$api.StatementList.add,
        method: 'post',
        data,
    })
}
// 报表编辑
export const editStatement = data => {
    return request({
        url: Vue.prototype.$api.StatementList.edit,
        method: 'post',
        data,
    })
}

// 报表列表
export const getStatementStatisticsList = data => {
    return request({
        url: Vue.prototype.$api.getStatementStatisticsList.index,
        method: 'post',
        data,
    })
}
// 报表编辑
export const editStatementStatistics = data => {
    return request({
        url: Vue.prototype.$api.getStatementStatisticsList.edit,
        method: 'post',
        data,
    })
}
// 合同批次号列表
export const queryContractList = data => {
    return request({
        url: Vue.prototype.$api.queryContractList.index,
        method: 'post',
        data,
    })
}
// 合同批次号修改
export const queryContractEdit = data => {
    return request({
        url: Vue.prototype.$api.queryContractList.edit,
        method: 'post',
        data,
    })
}
// 合同批次号添加
export const queryContractAdd = data => {
    return request({
        url: Vue.prototype.$api.queryContractList.add,
        method: 'post',
        data,
    })
}
// 合同批次号删除
export const queryContractDel = data => {
    return request({
        url: Vue.prototype.$api.queryContractList.del,
        method: 'post',
        data,
    })
}
//合同批次号详情
export const queryContractDetail = data => {
    return request({
        url: Vue.prototype.$api.queryContractList.detail,
        method: 'post',
        data,
    })
}
// contact_info
export const contact_info = data => {
    return request({
        url: Vue.prototype.$api.queryContractList.contact_info,
        method: 'post',
        data,
    })
}
// confirm_order
export const confirm_order = data => {
    return request({
        url: Vue.prototype.$api.queryContractList.confirm_order,
        method: 'post',
        data,
    })
}
// exportOnwaySku
export const export_onway_sku = data => {
    return request({
        url: Vue.prototype.$api.queryContractList.export_onway_sku,
        method: 'post',
        data,
        responseType: 'blob',
    })
}
export const getListingProductList = data => {
    return request({
        url: Vue.prototype.$api.listing.getListingProductList,
        method: 'post',
        data,
    })
}

export const export_hwc = data => {
    return request({
        url: Vue.prototype.$api.product.export_hwc,
        method: 'post',
        data,
        responseType: 'blob',
    })
}



export const queryStockInfo = data => {
    return request({
        url: Vue.prototype.$api.product.queryStockInfo,
        method: 'post',
        data,
    })
}


export const exportStockInfo = data => {
    return request({
        url: Vue.prototype.$api.product.exportStockInfo,
        method: 'post',
        data,
        responseType: 'blob',
    })
}

export const getInventorysList = data => {
    return request({
        url: Vue.prototype.$api.product.queryStock,
        method: 'post',
        data,
    })
}
// getSoleType
export const getSoleType = data => {
    return request({
        url: Vue.prototype.$api.product.getSoleType,
        method: 'post',
        data,
    })
}